<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./vue.js"></script>
    <script src="./vue-router.js"></script>
    <title>demo1</title>

</head>

<body>
<div id="app">
    <h1>VueRouter</h1>
    <p>
        <router-link to="/use/usename1/post/id1">/user/first</router-link>
        <router-link to="/use/usename2/post/id2">/user/second</router-link>
    </p>
    <router-view></router-view>
</div>
<script>
//const First = {template:'<div>first</div>'};
//const Second = {template:'<div>Second</div>'};
const User = {template:'<div>{{ $route.params}}</div>'};
    const routes = [
        {path:'/use/:usename/post/:post_id',component:User}
    ];
const router = new VueRouter({
    routes:routes
});
    const app = new Vue({
        router
    }).$mount('#app')
</script>
</body>

</html>